//
//  ApplyTableViewCell.m
//  one_mile_01
//
//  Created by 王雅蓉 on 15/9/8.
//  Copyright (c) 2015年 王雅蓉. All rights reserved.
//

#import "ApplyTableViewCell.h"

@interface ApplyTableViewCell ()
{
    UIImageView *bgImageView;
    UIImageView *hasSeenImageView;
    UILabel *aLine;
}

@end

@implementation ApplyTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self createSubviews];
    }
    
    return self;
}

-(void)createSubviews
{
    bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, COMMONCELLHEIGHT * FITRATE)];
    bgImageView.image = [UIImage imageNamed:@"kuangjia.png"];
    [self.contentView addSubview:bgImageView];
    
    self.applyTutorIV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * FITRATE, 10 * FITRATE, (COMMONCELLHEIGHT - 50) * FITRATE, (COMMONCELLHEIGHT - 50) * FITRATE)];
    //self.applyTutorIV.backgroundColor = [UIColor yellowColor];
    _applyTutorIV.layer.masksToBounds = YES;
    _applyTutorIV.layer.cornerRadius = 40 * FITRATE;
    [self.contentView addSubview:_applyTutorIV];
    
    self.applyTutorNameL = [[UILabel alloc] initWithFrame:CGRectMake(_applyTutorIV.frame.origin.x, _applyTutorIV.frame.origin.y + _applyTutorIV.frame.size.height, _applyTutorIV.frame.size.width, 40 * FITRATE)];
    //self.applyTutorNameL.backgroundColor = [UIColor yellowColor];
    self.applyTutorNameL.text = @"王雅蓉";
    self.applyTutorNameL.textAlignment = NSTextAlignmentCenter;
    self.applyTutorNameL.textColor = FONT_ASSISTANT_COLOR;
    self.applyTutorNameL.font = [UIFont systemFontOfSize:17.0f * FITRATE];
    self.applyTutorNameL.font = [UIFont boldSystemFontOfSize:17.5f * FITRATE];
    [self.contentView addSubview:_applyTutorNameL];
    
    //标题
    self.topicForApplyL = [[UILabel alloc] initWithFrame:CGRectMake(_applyTutorIV.frame.origin.x + _applyTutorIV.frame.size.width + 15 * FITRATE, _applyTutorIV.frame.origin.y + 5 * FITRATE, WIDTH - 10 * FITRATE - _applyTutorIV.frame.size.width - 40 * FITRATE, 50 * FITRATE)];
    //self.topicForApplyL.backgroundColor = [UIColor yellowColor];
    self.topicForApplyL.font = [UIFont systemFontOfSize:17.0f * FITRATE];
    self.topicForApplyL.numberOfLines = 2;
    self.topicForApplyL.text = @"聊一聊风险投资是怎么一回事";
    [self.contentView addSubview:_topicForApplyL];
    
    self.simInfoForApplyL = [[UILabel alloc] initWithFrame:CGRectMake(_topicForApplyL.frame.origin.x, _topicForApplyL.frame.origin.y + _topicForApplyL.frame.size.height, _topicForApplyL.frame.size.width, _topicForApplyL.frame.size.height - 25 * FITRATE)];
    self.simInfoForApplyL.textColor = RGBACOLOR(142, 142, 142, 1.0);
    self.simInfoForApplyL.font = [UIFont systemFontOfSize:15.0f * FITRATE];
    [self.contentView addSubview:_simInfoForApplyL];
//    //学校
//    self.schoolForApplyL = [[UILabel alloc] initWithFrame:CGRectMake(_topicForApplyL.frame.origin.x, _topicForApplyL.frame.origin.y + _topicForApplyL.frame.size.height , _topicForApplyL.frame.size.width - 30, _topicForApplyL.frame.size.height - 25)];
//    //self.schoolForApplyL.backgroundColor = [UIColor yellowColor];
//    self.schoolForApplyL.textColor = [UIColor colorWithRed:205 / 255.0 green:206 / 255.0 blue:206 / 255.0 alpha:1.0];
//    self.schoolForApplyL.font = [UIFont systemFontOfSize:15.0f];
//    [self.contentView addSubview:_schoolForApplyL];
//    
//    //职位
//    self.positionForApplyL = [[UILabel alloc] initWithFrame:CGRectMake(_schoolForApplyL.frame.origin.x, _schoolForApplyL.frame.origin.y + _schoolForApplyL.frame.size.height, _schoolForApplyL.frame.size.width, _schoolForApplyL.frame.size.height)];
//    self.positionForApplyL.font = [UIFont systemFontOfSize:14.0f];
//    self.positionForApplyL.textColor = [UIColor colorWithRed:205 / 255.0 green:206 / 255.0 blue:206 / 255.0 alpha:1.0];
//    [self.contentView addSubview:_positionForApplyL];
    
    aLine = [[UILabel alloc] initWithFrame:CGRectMake(_topicForApplyL.frame.origin.x, _simInfoForApplyL.frame.origin.y + _simInfoForApplyL.frame.size.height + 2 * FITRATE, _topicForApplyL.frame.size.width + 10 * FITRATE, 1 * FITRATE)];
    aLine.backgroundColor = [UIColor colorWithRed:235 / 255.0 green:236 / 255.0 blue:236 / 255.0 alpha:1.0];
    [self.contentView addSubview:aLine];
    
    //见过人数
    hasSeenImageView = [[UIImageView alloc] initWithFrame:CGRectMake(aLine.frame.origin.x, _applyTutorNameL.frame.origin.y + 5, _applyTutorNameL.frame.size.height - 20 * FITRATE, _applyTutorNameL.frame.size.height - 18 * FITRATE)];
    hasSeenImageView.image = [UIImage imageNamed:@"hasSeenIcon.png"];
    [self.contentView addSubview:hasSeenImageView];
    
    self.hasSeenForApplyL = [[UILabel alloc] initWithFrame:CGRectMake(hasSeenImageView.frame.origin.x + hasSeenImageView.frame.size.width + 5 * FITRATE, hasSeenImageView.frame.origin.y + 3 * FITRATE, (_topicForApplyL.frame.size.width - 40 * FITRATE) / 2.0 - 10 * FITRATE, hasSeenImageView.frame.size.height)];
    //self.hasSeenForApplyL.backgroundColor = [UIColor yellowColor];
    self.hasSeenForApplyL.text = @" 9人见过";
    if (iPhone5 || iPhone4s) {
        self.hasSeenForApplyL.font = [UIFont systemFontOfSize:12.0f * FITRATE];
        //self.hasSeenForApplyL.font = [UIFont boldSystemFontOfSize:11.5f];
    } else {
        self.hasSeenForApplyL.font = [UIFont systemFontOfSize:14.0f * FITRATE];
        //self.hasSeenForApplyL.font = [UIFont boldSystemFontOfSize:13.5f];
    }
    self.hasSeenForApplyL.textColor = FONT_DARKGREY_COLOR;
    [self.contentView addSubview:_hasSeenForApplyL];
    
    self.clickNumberForApplyL = [[UILabel alloc] initWithFrame:CGRectMake(_hasSeenForApplyL.frame.origin.x + _hasSeenForApplyL.frame.size.width, _hasSeenForApplyL.frame.origin.y, aLine.frame.size.width - _hasSeenForApplyL.frame.size.width - hasSeenImageView.frame.size.width, _hasSeenForApplyL.frame.size.height)];
    //self.clickNumberForApplyL.backgroundColor = [UIColor yellowColor];
    //self.clickNumberForApplyL.text = @"1444/ 次";
    self.clickNumberForApplyL.textAlignment = NSTextAlignmentRight;
    self.clickNumberForApplyL.textColor = FONT_DARKGREY_COLOR;
    if (iPhone5 || iPhone4s) {
        self.clickNumberForApplyL.font = [UIFont systemFontOfSize:12.0f * FITRATE];
    } else {
        self.clickNumberForApplyL.font = [UIFont systemFontOfSize:14.0f * FITRATE];
    }
    [self.contentView addSubview:_clickNumberForApplyL];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
